* create roll call vote data
{
* 113 Congress - 2013 (1st session)
cd $dropbox/research_projects/survey_non_response
clear
set more off
import delimited "http://clerk.house.gov/evs/2013/roll001.xml"
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http://clerk.house.gov/evs/2013/roll001.xml"
gen year=2013
gen congress=113
gen rollcall=1
drop v1 v21 v22 v222 v31 v32 v322
saveold congress_rollcall.dta, replace

local slash "//"
set more off
forval x=2/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2013/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2013/roll00`x'.xml"
gen year=2013
gen congress=113
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2013/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2013/roll0`x'.xml"
gen year=2013
gen congress=113
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/641 {
clear
import delimited http:`slash'clerk.house.gov/evs/2013/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2013/roll`x'.xml"
gen year=2013
gen congress=113
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

*********
* 113 Congress - 2014 (2nd session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2014/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2014/roll00`x'.xml"
gen year=2014
gen congress=113
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2014/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2014/roll0`x'.xml"
gen year=2014
gen congress=113
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/274 {
clear
import delimited http:`slash'clerk.house.gov/evs/2014/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2014/roll`x'.xml"
gen year=2014
gen congress=113
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=276/564 {
clear
import delimited http:`slash'clerk.house.gov/evs/2014/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2014/roll`x'.xml"
gen year=2014
gen congress=113
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}


* 112 Congress - 2011 (1st session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2011/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2011/roll00`x'.xml"
gen year=2011
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2011/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2011/roll0`x'.xml"
gen year=2011
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/483 {
clear
import delimited http:`slash'clerk.house.gov/evs/2011/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2011/roll`x'.xml"
gen year=2011
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=485/949 {
clear
import delimited http:`slash'clerk.house.gov/evs/2011/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2011/roll`x'.xml"
gen year=2011
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 112 Congress - 2012 (2nd session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2012/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2012/roll00`x'.xml"
gen year=2012
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2012/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2012/roll0`x'.xml"
gen year=2012
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/326 {
clear
import delimited http:`slash'clerk.house.gov/evs/2012/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2012/roll`x'.xml"
gen year=2012
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=328/659 {
clear
import delimited http:`slash'clerk.house.gov/evs/2012/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2012/roll`x'.xml"
gen year=2012
gen congress=112
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}


* 111 Congress - 2009 (1st session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2009/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2009/roll00`x'.xml"
gen year=2009
gen congress=111
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2009/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2009/roll0`x'.xml"
gen year=2009
gen congress=111
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/991 {
clear
import delimited http:`slash'clerk.house.gov/evs/2009/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2009/roll`x'.xml"
gen year=2009
gen congress=111
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 111 Congress - 2010 (2nd session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2010/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2010/roll00`x'.xml"
gen year=2010
gen congress=111
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2010/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2010/roll0`x'.xml"
gen year=2010
gen congress=111
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/664 {
clear
import delimited http:`slash'clerk.house.gov/evs/2010/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2010/roll`x'.xml"
gen year=2010
gen congress=111
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 110 Congress - 2007 (1st session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2007/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2007/roll00`x'.xml"
gen year=2007
gen congress=110
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2007/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2007/roll0`x'.xml"
gen year=2007
gen congress=110
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/1186 {
clear
import delimited http:`slash'clerk.house.gov/evs/2007/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2007/roll`x'.xml"
gen year=2007
gen congress=110
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 110 Congress - 2008 (2nd session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2008/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2008/roll00`x'.xml"
gen year=2008
gen congress=110
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2008/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2008/roll0`x'.xml"
gen year=2008
gen congress=110
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/690 {
clear
import delimited http:`slash'clerk.house.gov/evs/2008/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2008/roll`x'.xml"
gen year=2008
gen congress=110
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 109 Congress - 2005 (1st session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2005/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2005/roll00`x'.xml"
gen year=2005
gen congress=109
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2005/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2005/roll0`x'.xml"
gen year=2005
gen congress=109
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/671 {
clear
import delimited http:`slash'clerk.house.gov/evs/2005/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2005/roll`x'.xml"
gen year=2005
gen congress=109
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 109 Congress - 2006 (2nd session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2006/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2006/roll00`x'.xml"
gen year=2006
gen congress=109
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2006/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2006/roll0`x'.xml"
gen year=2006
gen congress=109
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/543 {
clear
import delimited http:`slash'clerk.house.gov/evs/2006/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2006/roll`x'.xml"
gen year=2006
gen congress=109
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 108 Congress - 2004 (2nd session)

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2004/roll00`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2004/roll00`x'.xml"
gen year=2004
gen congress=108
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2004/roll0`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2004/roll0`x'.xml"
gen year=2004
gen congress=108
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/544 {
clear
import delimited http:`slash'clerk.house.gov/evs/2004/roll`x'.xml
split v1, p(`"name=""') gen(v2)
split v22, p(`"" party="')
rename v221 name
split v1, p(`"state=""') gen(v3)
split v32, p(`"" role="')
rename v321 state
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2004/roll`x'.xml"
gen year=2004
gen congress=108
gen rollcall=`x'
drop v1 v21 v22 v222 v31 v32 v322
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 106th Congress - 2000

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/2000/roll00`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2000/roll00`x'.xml"
gen year=2000
gen congress=106
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/2000/roll0`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2000/roll0`x'.xml"
gen year=2000
gen congress=106
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/603 {
clear
import delimited http:`slash'clerk.house.gov/evs/2000/roll`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/2000/roll`x'.xml"
gen year=2000
gen congress=106
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 104th Congress - 1996

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/1996/roll00`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/1996/roll00`x'.xml"
gen year=1996
gen congress=104
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/1996/roll0`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/1996/roll0`x'.xml"
gen year=1996
gen congress=104
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/455 {
clear
import delimited http:`slash'clerk.house.gov/evs/1996/roll`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/1996/roll`x'.xml"
gen year=1996
gen congress=104
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

* 102th Congress - 1992

local slash "//"
set more off
forval x=1/9 {
clear
import delimited http:`slash'clerk.house.gov/evs/1992/roll00`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/1992/roll00`x'.xml"
gen year=1992
gen congress=102
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=10/99 {
clear
import delimited http:`slash'clerk.house.gov/evs/1992/roll0`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/1992/roll0`x'.xml"
gen year=1992
gen congress=102
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

local slash "//"
set more off
forval x=100/488 {
clear
import delimited http:`slash'clerk.house.gov/evs/1992/roll`x'.xml
split v1, p(`"role="legislator">"') gen(v2)
split v22, p("</legislator>") gen(v3)
rename v31 name
keep v1 name
gen party=1 if strmatch(v1,`"*party="R"*"')
replace party=2 if strmatch(v1,`"*party="D"*"')
split v1, p(`"" state=""') gen(v2)
split v22, p(`"""') gen(v4)
rename v41 state
keep v1 name party state
gen vote=1 if strmatch(v1,`"*<vote>Yea</vote>*"') | strmatch(v1,`"*<vote>Aye</vote>*"')
replace vote=2 if strmatch(v1,`"*<vote>Nay</vote>*"') | strmatch(v1,`"*<vote>No</vote>*"')
gen url="http:`slash'clerk.house.gov/evs/1992/roll`x'.xml"
gen year=1992
gen congress=102
gen rollcall=`x'
drop v1
display `x'
append using congress_rollcall.dta
saveold congress_rollcall.dta, replace
}

****
*tests
clear
use congress_rollcall.dta, clear

*sort vote
drop if missing(party)
recode party (1=1) (2=0), gen(rep)
recode party (1=0) (2=1), gen(dem)
recode vote (1=1) (2=0), gen(yes)
recode vote (1=0) (2=1), gen(no)
collapse (sum) rep dem yes no, by(rollcall year)

tab year
tab rollcall if rep==0
tab rollcall if dem==0
egen vote_total=rowtotal(yes no)
tab rollcall year if vote_total==0

cd $dropbox/research_projects/survey_non_response
clear
use congress_rollcall.dta, clear
drop if missing(party)
recode vote (1=1) (2=0), gen(VOTE)
saveold congress_rollcall.dta, replace

* t tests
* 2004
cd $dropbox/research_projects/survey_non_response
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==2 & year==2004, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=2
gen year==2004
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==2 & year==2004, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=2
gen year==2004
saveold congress_d.dta, replace

forval x=3/544 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2004, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year==2004
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2004, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year==2004
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2005
forval x=3/602 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2005, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2005
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2005, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2005
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=604/671 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2005, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2005
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2005, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2005
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2006
forval x=2/537 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2006, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2006
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2006, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2006
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=539/543 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2006, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2006
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2006, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2006
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2007
forval x=3/353 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2007
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==355 & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=355
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==355 & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=355
gen year=2007
append using congress_d.dta
saveold congress_d.dta, replace

clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==357 & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=357
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==357 & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=357
gen year=2007
append using congress_d.dta
saveold congress_d.dta, replace

clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==359 & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=359
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==359 & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=359
gen year=2007
append using congress_d.dta
saveold congress_d.dta, replace

clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==361 & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=361
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==361 & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=361
gen year=2007
append using congress_d.dta
saveold congress_d.dta, replace

forval x=363/774 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2007
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=776/1105 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2007
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=1107/1138 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2007
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=1140/1186 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2007, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2007
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2007, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2007
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2008
forval x=2/138 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2008, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2008
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2008, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2008
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=140/690 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2008, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2008
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2008, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2008
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2009
forval x=3/413 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2009, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2009
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2009, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2009
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=415/986 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2009, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2009
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2009, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2009
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=988/989 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2009, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2009
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2009, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2009
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==991 & year==2009, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=991
gen year=2009
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==991 & year==2009, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=991
gen year=2009
append using congress_d.dta
saveold congress_d.dta, replace

* 2010
forval x=2/100 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2010, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2010
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2010, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2010
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=102/423 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2010, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2010
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2010, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2010
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=425/426 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2010, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2010
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2010, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2010
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=428/664 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2010, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2010
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2010, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2010
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2011
forval x=3/6 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2011, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2011
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2011, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2011
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=8/483 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2011, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2011
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2011, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2011
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=485/688 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2011, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2011
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2011, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2011
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=690/949 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2011, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2011
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2011, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2011
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2012
forval x=2/326 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2012, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2012
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2012, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2012
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=328/659 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2012, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2012
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2012, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2012
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2013
forval x=3/641 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2013, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2013
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2013, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2013
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2014
forval x=2/274 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2014, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2014
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2014, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2014
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=276/564 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2014, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2014
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2014, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2014
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 2000
forval x=2/225 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2000, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2000
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2000, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2000
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=227/284 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2000, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2000
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2000, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2000
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=286/603 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==2000, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=2000
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==2000, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=2000
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 1996
forval x=2/455 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1996, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1996
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1996, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1996
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

* 1992
forval x=2/26 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==28 & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=28
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==28 & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=28
gen year=1992
display 28
append using congress_d.dta
saveold congress_d.dta, replace

forval x=30/59 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=61/158 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==160 & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=160
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==160 & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=160
gen year=1992
display 160
append using congress_d.dta
saveold congress_d.dta, replace

forval x=162/191 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=193/195 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=197/211 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=213/227 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=229/236 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=238/296 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=298/372 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=374/404 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=406/465 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}

forval x=467/488 {
set more off
clear
use congress_rollcall.dta, clear
quietly ttest vote if rollcall==`x' & year==1992, by(party)
svret r, keep(r(N_1) r(N_2) r(p) r(mu_1) r(mu_2) r(sd_1) r(sd_2) r(t) r(df_t))
gen rollcall=`x'
gen year=1992
append using congress_t.dta
saveold congress_t.dta, replace
clear
use congress_rollcall.dta, clear
quietly esize twosample vote if rollcall==`x' & year==1992, by(party) cohensd
svret r, keep(r(d) r(lb_d) r(ub_d))
gen rollcall=`x'
gen year=1992
display `x'
append using congress_d.dta
saveold congress_d.dta, replace
}


*************
* match rollcall to bill
*************

* 2004
set more off
clear
import delimited http://clerk.house.gov/evs/2004/ROLL_000.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2004
gen congress=108
saveold rc_bills.dta, replace

local slash "//"

forval x=1/5 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2004/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2004
gen congress=108
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2005

set more off
local slash "//"

forval x=0/6 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2005/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2005
gen congress=109
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2006

set more off
local slash "//"

forval x=0/5 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2006/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2006
gen congress=109
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2007

set more off
local slash "//"

forval x=0/11 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2007/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2007
gen congress=110
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2008

set more off
local slash "//"

forval x=0/6 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2008/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2008
gen congress=110
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2009

set more off
local slash "//"

forval x=0/9 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2009/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2009
gen congress=111
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2010

set more off
local slash "//"

forval x=0/6 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2010/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2010
gen congress=111
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2011

set more off
local slash "//"

forval x=0/9 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2011/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2011
gen congress=112
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2012

set more off
local slash "//"

forval x=0/6 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2012/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2012
gen congress=112
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2013

set more off
local slash "//"

forval x=0/6 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2013/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2013
gen congress=113
append using rc_bills.dta
saveold rc_bills.dta, replace
}

* 2014

set more off
local slash "//"

forval x=0/5 {
clear
display `x'
import delimited http:`slash'clerk.house.gov/evs/2014/ROLL_`x'00.asp

gen str temp=substr(v1,strpos(v1,"rollnumber="),strpos(v1,`"">"')-strpos(v1,"rollnumber="))
replace temp=substr(v1,strpos(v1,">"),strpos(v1,"</")-strpos(v1,">")) if strmatch(v1,"<A HREF=*")
drop if temp==""
split temp, p("rollnumber=")
gen billid=temp[_n+1]
replace billid="" if strmatch(billid,"rollnumber=*")
destring temp2, replace
rename temp2 rollcall
drop if missing(rollcall)
replace billid=subinstr(billid,">","",.)
keep rollcall billid
gen year=2014
gen congress=113
append using rc_bills.dta
saveold rc_bills.dta, replace
}

clear
use rc_bills.dta, clear
gen billnum = regexr(billid,".+ ","")
destring billnum, replace
saveold rc_bills.dta, replace

clear
insheet using "$dropbox/apoi/data/policy agendas project/Roll_Call_Votes.csv"
keep if year>2003
keep if chamber==1
keep sesscount cong year majortopic
rename cong congress
rename sesscount rollcall
drop congress
merge 1:1 rollcall year using congress_t.dta
drop if _merge==1
saveold congress_t.dta, replace
*****

clear
import excel using bills_108_113_pap.xlsx, firstrow
rename _all, lower
rename cong congress
keep if congress==113
drop if strmatch(billid,"*S*")
keep billnum congress major
duplicates drop billnum congress, force
merge 1:m billnum congress using rc_bills.dta
drop if _merge==1
keep if congress==113
keep rollcall year major
rename major majortopic
saveold rc_bills_113.dta, replace

clear
use congress_t.dta, clear
drop _merge
merge 1:1 rollcall year using rc_bills_113.dta, update
drop _merge

saveold congress_t.dta, replace